package com.lhdx.practical.bean;

import com.lhdx.practical.utils.IDGenerator;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 单元成绩实体
 */
@Entity
@Table(name="performance")
public class Performance {
    @Id
    private long id;

    private long mid;
    private long sid;

    private long personid;

    private long gradeid;

    private String personname;
    /**
     * 总分
     */
    private double totalscore;
    /**
     * 平时成绩
     */
    private double usualscore;
    /**
     * 小组成绩
     */
    private double groupscore;
    /**
     * 个人成绩
     */
    private double personscore;

    public Performance(){}

    public Performance(long mid,long sid,Person person,double totalscore,double usualscore,double groupscore,double personscore){
        this.id = IDGenerator.getID();
        this.mid = mid;
        this.sid = sid;
        this.personid = person.getId();
        this.personname = person.getRealname();
        this.gradeid = person.getGradeid();
        this.totalscore = totalscore;
        this.usualscore = usualscore;
        this.groupscore = groupscore;
        this.personscore = personscore;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getSid() {
        return sid;
    }

    public void setSid(long sid) {
        this.sid = sid;
    }

    public long getPersonid() {
        return personid;
    }

    public void setPersonid(long personid) {
        this.personid = personid;
    }

    public String getPersonname() {
        return personname;
    }

    public void setPersonname(String personname) {
        this.personname = personname;
    }

    public double getTotalscore() {
        return totalscore;
    }

    public void setTotalscore(double totalscore) {
        this.totalscore = totalscore;
    }

    public double getUsualscore() {
        return usualscore;
    }

    public void setUsualscore(double usualscore) {
        this.usualscore = usualscore;
    }

    public double getGroupscore() {
        return groupscore;
    }

    public void setGroupscore(double groupscore) {
        this.groupscore = groupscore;
    }

    public double getPersonscore() {
        return personscore;
    }

    public void setPersonscore(double personscore) {
        this.personscore = personscore;
    }

    public long getMid() {
        return mid;
    }

    public void setMid(long mid) {
        this.mid = mid;
    }

    public long getGradeid() {
        return gradeid;
    }

    public void setGradeid(long gradeid) {
        this.gradeid = gradeid;
    }
}
